package DesignPatterns;

public class Proxy {
    public static void main(String[] args) {
        School school=new Canteen();
        school.dosomething();
    }
}
interface School{
    void dosomething();
}
class Student implements School{
    @Override
    public void dosomething() {
        System.out.println("学生：吃饭！");
        System.out.println("学生：好好学习，天天向上!");
    }
}
class Canteen implements School{
    private School student=new Student();
    @Override
    public void dosomething() {
        System.out.println("食堂：炒菜，做饭！");
        student.dosomething();
        System.out.println("食堂：洗碗！");
    }
}